import * as API from "@/api/axios";
import * as util from "@/common/util";

export default {

    createModify: (params) => {
        const url = '/manage/deposits'
        const headers = {
            'lang-key': params.id ? 'branch_Edit' : 'branch_Create'
        }
        if (params.id) {
            return API.axiosPutAPI(url, params, headers)
        } else {
            return API.axiosPostAPI(url, params, headers)
        }
    },

    getDetail: (id) => {
        return API.axiosGetAPI(`/manage/deposits/${id}`)
    },

    //计费规则-列表(全部)
    getBillingList: params => {
        return API.axiosGetAPI('/manage/deposits/all', params)
    },

    // 获取计费规则下的网点列表
    getBillingShopList: (id, params) => {
        return API.axiosGetAPI(`/manage/deposits/${id}/branches/${params.pageNum}/${params.pageSize}`, params)
    },

    // 删除计费规则
    remove: params => {
        const headers = {
            'lang-key': 'delete'
        }
        return API.axiosDeleteAPI(`/manage/deposits/${params.id}`, null, headers)
    },

    // 计费规则-批量更换网点规则
    batchModifyBranchRule: params => {
        // const headers = {
        //     'lang-key': 'settingPrepaymentRuleChange'
        // }
        return API.axiosPutAPI('/manage/deposits/branch/batch', params, headers)
    },

    // 计费规则-更换所有网点规则
    modifyAllBranchRule: params => {
        // const headers = {
        //     'lang-key': 'settingPrepaymentRuleChange'
        // }
        return API.axiosPutAPI('/manage/deposits/branch/all', params, headers)
    },


}